export default function hashmap () {
    this.data = {}
    this.put = function (key, value) {
      this.data[key] = value
    }
    this.del = function (key) {
      delete this.data[key]
    }
    this.get = function (key) {
      return this.containsKey(key) ? this.data[key] : null
    }
    this.keySet = function () {
      var _keys = []
      for (var key in this.data) {
        _keys.push(key)
      }
      return _keys
    }
    this.getAllvalues = function(){
      var _values = []
      for (var key in this.data) {
        if(this.data[key].children.length>0){
          _values.push(this.data[key])
        }
        
      }
      return _values
    }
    this.containsKey = function (_key) {
      return (_key in this.data)
    }
    this.clear = function () {
      this.data.length = 0
      this.data = {}
    }
    
  }
  